package com.test;
/*
// 定义Animal类
class Animal {
    public void shout() {
        System.out.println("动物叫声");
    }
}

// 定义Dog类
class Dog extends Animal {
    // 重写shout()方法
    public void shout() {
        System.out.println("汪汪……");
    }

    public void eat() {
        System.out.println("吃骨头……");
    }
}

public class Example08 {
    public static void main(String[] args){
        Animal animal_1=new Dog();   //子类->父类
        Dog dog1=(Dog)animal_1;     //强制类型转换  父类->子类
        dog1.shout();
        dog1.eat();
    }
}

 */
